package com.example.xpagedemoproject.fragment;

import android.content.Intent;

import com.example.xpagedemoproject.ComplexActivity;
import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xpage.base.XPageSimpleListFragment;
import com.xuexiang.xutil.app.ActivityUtils;

import java.util.List;

@Page(name = "复杂使用")
public class ComplexPageFragment extends XPageSimpleListFragment {
    @Override
    protected List<String> initSimpleData(List<String> lists) {
        lists.add("复杂页面使用（非ViewPager）");
        lists.add("Tab主页使用（ViewPager）");
        lists.add("加载module中的页面");
        lists.add("打开新的Activity，并且不加入返回堆栈，适合某些只能一步到头的业务");
        return lists;
    }

    @Override
    protected void onItemClick(int position) {
        switch (position) {
            case 0:
                ActivityUtils.startActivity(ComplexActivity.class);
                //startActivity(new Intent(getContext(),ComplexActivity.class));
                break;
        }
    }
}
